package com.baizhi.springmvc.service.imp;


import com.baizhi.springmvc.dao.CategoryDao;
import com.baizhi.springmvc.entity.Category;
import com.baizhi.springmvc.service.CategoryService;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImp implements CategoryService {
    @Autowired
    private CategoryDao categoryDao;
    @Override
    public List<Category> selectAllFirst() {
        List<Category> categoryList = categoryDao.selectAllFirst();
        return categoryList;
    }

    @Override
    public List<Category> selectCateByFirstLevel(Integer categoryid) {
        List<Category> categoryList = categoryDao.selectCateByFirstLevel(categoryid);
        return categoryList;
    }

    @Override
    public List<Category> selectCateByTwoLevel(Integer categoryid) {
        List<Category> categoryList = categoryDao.selectCateByTwoLevel(categoryid);
        return categoryList;
    }



    @Override
    public Category selectParentCategory(Integer categoryid) {
        Category category = categoryDao.selectParentCategory(categoryid);
        return category;
    }

    @Override
    public Category selectCategoryName(Integer categoryid) {
        Category category = categoryDao.selectCategoryName(categoryid);
        return category;
    }
}
